using System;

namespace Coding4Fun.BluetoothPanoHead
{
    /// <summary>
    /// Container class for pano commands.  Splits the command into the action and the option parameters
    /// </summary>
    public class ControlCommand
    {
        public string Action { get; set; }
        public string[] Params;
        public ControlCommand(string value)
        {
            value = value.Substring(1, value.Length - 2);

            string[] foo = value.Split(',');

            Action = foo[0];

            if (foo.Length > 1)
            {
                Params = new string[foo.Length - 1];
                Array.Copy(foo, 1, Params, 0, foo.Length - 1);
            }
        }
    }
}
